package com.yanqu.road.server.cmd.wingroom;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.wingroom.WingRoomProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.wingroom.CrossWingRoomMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_WING_ROOM_CROSS_GET_VISIT_REWARD, desc = "领取拜访结束奖励")
public class CrossGetVisitRewardCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        WingRoomProto.CrossGetVisitRewardRespMsg.Builder messageBuilder = CrossWingRoomMgr.getVisitReward(packet.getPlayerId());
        if(messageBuilder != null){
            MessageHelper.sendPacket(serverId, packet.getPlayerId(), YanQuMessageUtils.buildMessage(Protocol.S_WING_ROOM_CROSS_GET_VISIT_REWARD_RESP,
                    messageBuilder));
        }

    }

    @Override
    public void sendData() {

    }
}
